package com.canaan.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.canaan.common.annotation.Excel;
import com.canaan.common.core.domain.BaseEntity;
import com.canaan.common.annotation.TableName;
/**
 * Api日志记录对象 sys_api_log
 *
 * @author canaan
 * @date 2025-03-23
 */
@TableName("sys_api_log")
public class ApiLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 日志主键 */
    private Long logId;

    /** 模块标题 */
    @Excel(name = "模块标题")
    private String title;

    /** 方法名称 */
    @Excel(name = "方法名称")
    private String method;

    /** 请求方式 */
    @Excel(name = "请求方式")
    private String requestMethod;

    /** 请求URL */
    @Excel(name = "请求URL")
    private String operUrl;

    /** 主机地址 */
    @Excel(name = "主机地址")
    private String operIp;

    /** 请求参数 */
    @Excel(name = "请求参数")
    private String operParam;

    /** 返回参数 */
    @Excel(name = "返回参数")
    private String jsonResult;

    /** 操作状态（0正常 1异常） */
    @Excel(name = "操作状态", readConverterExp = "0=正常,1=异常")
    private Integer status;

    /** 错误消息 */
    @Excel(name = "错误消息")
    private String errorMsg;

    /** 日志时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "日志时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date logTime;

    public void setLogId(Long logId)
    {
        this.logId = logId;
    }

    public Long getLogId()
    {
        return logId;
    }
    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getTitle()
    {
        return title;
    }
    public void setMethod(String method)
    {
        this.method = method;
    }

    public String getMethod()
    {
        return method;
    }
    public void setRequestMethod(String requestMethod)
    {
        this.requestMethod = requestMethod;
    }

    public String getRequestMethod()
    {
        return requestMethod;
    }
    public void setOperUrl(String operUrl)
    {
        this.operUrl = operUrl;
    }

    public String getOperUrl()
    {
        return operUrl;
    }
    public void setOperIp(String operIp)
    {
        this.operIp = operIp;
    }

    public String getOperIp()
    {
        return operIp;
    }
    public void setOperParam(String operParam)
    {
        this.operParam = operParam;
    }

    public String getOperParam()
    {
        return operParam;
    }
    public void setJsonResult(String jsonResult)
    {
        this.jsonResult = jsonResult;
    }

    public String getJsonResult()
    {
        return jsonResult;
    }
    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }
    public void setErrorMsg(String errorMsg)
    {
        this.errorMsg = errorMsg;
    }

    public String getErrorMsg()
    {
        return errorMsg;
    }
    public void setLogTime(Date logTime)
    {
        this.logTime = logTime;
    }

    public Date getLogTime()
    {
        return logTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("operId", getLogId())
            .append("title", getTitle())
            .append("method", getMethod())
            .append("requestMethod", getRequestMethod())
            .append("operUrl", getOperUrl())
            .append("operIp", getOperIp())
            .append("operParam", getOperParam())
            .append("jsonResult", getJsonResult())
            .append("status", getStatus())
            .append("errorMsg", getErrorMsg())
            .append("logTime", getLogTime())
            .toString();
    }
}
